package com.iussoft.tdengine.util;


import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.core.env.Environment;

/**
 * 获取配置文转到map中
 */
public class PropertiesConfig extends PropertyPlaceholderConfigurer {

    private static Environment ctxSysMap = null;

    public static String getApplicatinConfig(String key) {
        if(null != ctxSysMap) {
            return ctxSysMap.getProperty(key);
        }
        return "";
    }

    public static void setApplicatinConfig(Environment env) {
        if(PropertiesConfig.ctxSysMap == null){
            PropertiesConfig.ctxSysMap = env;
        }
    }
}
